public class Test_Demol2 {
    public static void main(String args[]){
        //for的语句的学习：


        //计算1-100的和：
        int sum = 0;
        for(int i = 1 ;i <= 100;i ++ ){
            sum +=i;
        }
        System.out.println("1-100的和为" + sum);

        //计算5的阶乘：
        int ret = 1;
        for(int i = 1;i <= 5;i ++){
           ret *= i;
        }
        System.out.println("5的阶乘为" + ret);

        //计算1！+2！+3！+4！+5！：
        int j = 1;
        int total = 0;
        while(j <= 5){
            int tmp = 1;
            for(int i = 1;i <= j;i ++){
                tmp *= i;
            }
            total += tmp;
            j++;
        }
        System.out.println("1！+2！+3！+4！+5！的和为：" + total);
    }
}
